<li class="dropdown">
    <a href="#" class="dropdown-toggle active" data-toggle="dropdown" role="button" aria-haspopup="true"
       aria-expanded="false">项目
        <span>{# 显示当前选择的项目名 #}
            {% if request.tracer.project %}
                ( {{ request.tracer.project.name }})
            {% endif %}</span>
        <span class="caret"></span></a>
    <ul class="dropdown-menu">
        {% if my %}
            <li><a><i class="fa fa-address-book-o" aria-hidden="true"></i>&nbsp;我创建的项目</a></li>
            {% for item in my %}
                <li><a href="{% url 'dashboard' project_id=item.id %}" class="active"
                       style="color: gray">{{ item.name }}</a></li>
            {% endfor %}
        {% endif %}
        {% if join %}
            <li role="separator" class="divider"></li>
            <li><a><i class="fa fa-sign-in" aria-hidden="true"></i>&nbsp;我参与的项目</a></li>
            {% for item in join %}
                <li><a href="#" class="active" style="color: gray">{{ item.project.name }}</a></li>
            {% endfor %}
        {% endif %}
        <li role="separator" class="divider"></li>
        <li><a href="{% url 'project_list' %}" class="active"><i class="fa fa-globe"
                                                                 aria-hidden="true">&nbsp;所有项目</i></a></li>
    </ul>
</li>
